#include<iostream>
using namespace std;
int a[2];
void  get(int n,int m)
{
	int a = n;
	int b  = m;
	if(m > n)
	{
		swap(m,n);
	}
	int tem = n % m;
	while(tem)
	{
		n = m;
		m = tem;
		tem = n % m;
	}
	a[0] = m;
	int res = a > b ? a : b;
	while(res % a || res % b)
	{
		res++;
	}
	a[1] = res;
}
int main()
{
	int n, m;
	cin >> n >> m;
	for(auto i : a)
	{
		cout << i  << ' ';
	}
	return 0;
}
